package com.ship.dispatch.mapper.fob;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ship.dispatch.bean.fob.SpFobJsfhccbItems;
import liquibase.pro.packaged.S;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author yl
 * @title SpFobJsfhccbItemsMapper
 * @description
 * @create 2023/12/28 0028
 */
public interface SpFobJsfhccbItemsMapper extends BaseMapper<SpFobJsfhccbItems> {
    @Select("select id,contract_price,trade_model*1 as trade_model,delivery_type*1 as delivery_type from con_resource_memorandum where id = #{resourceContract}")
    Map<String, Object> getResouceMainContract(@Param("resourceContract") Long resourceContract);

    @Select("select * from sp_fob_jsfhccb_items where jsfhccb_id in(\n" +
            "select id from sp_fob_jsfhccb where procee_instance_id=#{processInstanceId} and `status`!=-2\n" +
            ") and table_id=#{tableId}")
    List<SpFobJsfhccbItems> findHistoryData(@Param("processInstanceId") String processInstanceId, @Param("tableId") String tableId);
}
